#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：    drag_and_drop_page.py
   Author :       zyq
   CreateDate：   2024/8/2 14:06
   Remark :  Python descriptor
-------------------------------------------------
"""
import allure
from guitesting.common.bash.bash_ui.page_element import PageElement, BasePage
from selenium.webdriver.common.by import By


class DragAndDropPage(BasePage):
    url = "http://xn--6frwj470ei1s2kl.com/demo/drag"
    # 去瀑布口
    div_c7 = PageElement(xpath="""/html/body/div[1]/div/div/main/div/div/div[1]/div[2]""")

    @allure.step("打开页面")
    def open_page(self):
        """
        :return:
        """
        self.get_url(self.url)

    @allure.step("拖拽到正在做")
    def drag_and_drop(self):
        """
        :return:
        """
        # 拖拽到正在做
        self.div_c7.drag_and_drop(target=(By.XPATH, """/html/body/div[1]/div/div/main/div/div/div[2]"""))
